#ifndef MODEL_LOCATOR_H

#define MODEL_LOCATOR_H

#include <map>
#include <string>
#include "ModelFrame.h"

using namespace std;

class ModelLocator
{
public:

	// Returns the singleton instance
	static ModelLocator* instance();

	// Destructor can be public
	~ModelLocator(){};

	ModelFrame* getFrame	( )									{ return this->frame; };
	void		addFrame	( string key, ModelFrame* frame )	{ this->frames[key] = frame; };
	void		setFrame	( string key )						{ this->frame = this->frames[key]; };
	void        setFrame	( ModelFrame* frame )				{ this->frame = frame; };
	void		clear		(  )								{ this->frames.clear(); };

protected:

	// Constructor must be protected
	ModelLocator(){	frame = NULL; };

private:

	// Singleton instance
	static ModelLocator* singleton;

	ModelFrame* frame;
	std::map<string, ModelFrame*> frames;

};

#endif